import {request} from './requests'

export function getProductList(categoryId = 100012, pageSize = 6) {
    return request({
        url: 'products',
        method: 'get',
        params: {
            categoryId: categoryId,
            pageSize: pageSize
        }
    })
}

export function addCart(productId) {
    return request({
        url: 'carts',
        method: 'post',
        data: {
            productId: productId,
            selected: true
        }
    })
}

export function getUserCount() {
    return request({
        url: '/user',
        method: 'get'
    })
}
export function getCartCount() {
    return request({
        url: '/carts/products/sum',
        method: 'get'
    })
}
